package com.cloudsigns.factorymanager2.operate_maintain.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;

import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.operate_maintain.adapter.OpearteMaintainScheduleInforCalendarAdapter;
import com.cloudsigns.factorymanager2.operate_maintain.util.CalendarUtil;
import com.cloudsigns.factorymanager2.operate_maintain.util.MyGridview;

public class OperateMaintainScheduleInformationFragment extends Fragment{
    private static final String TAG = "OperateMaintainScheduleInformationFragment";
    private MyGridview gridView;
    private OpearteMaintainScheduleInforCalendarAdapter adapter;
    private int year;
    private int month;
    private int[][] days = new int[5][7];

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragment_operate_maintain_schedule_information,null);
        gridView=view.findViewById(R.id.calendar_gridView);
        year = CalendarUtil.getYear();
        month = CalendarUtil.getMonth();
        days = CalendarUtil.getDayOfMonthFormat(year, month);
        adapter = new OpearteMaintainScheduleInforCalendarAdapter(getActivity(), days, year, month);//传入当前月的年
        gridView.setAdapter(adapter);
        gridView.setEnabled(false);
        return view;
    }
}
